home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / gfx / 3d / isl_1_2.lzh / ISL.doc < prev    next >
Text File  |  1993-02-10  |  6KB  |  130 lines

  1. ISL.doc - Copyright (c) 1992 John T. Grieggs, last modified 02-10-93
  2.  
  3. Current ISL version - 1.2.
  4.  
  5. ISL, the Imagine Staging Language, is a language created to make the
  6. generation and manipulation of Imagine 2.0 staging files a whole lot
  7. easier.  If you have ever used the Action editor in earnest, you know
  8. that certain types of operations are easy (such as adding a single
  9. light) while others are not (such as adding more frames and causing
  10. your existing objects to appear in them).
  11.  
  12. ISL provides an alternative interface to the Action editor.  With ISL,
  13. you can create your stage using the Stage and Action editors as needed,
  14. then convert it to a fairly straightforward ASCII format, edit it as
  15. desired using your favorite text editor, then put it back!  This is of
  16. course the simplest way of using ISL - you could also create stages
  17. programatically.  I have done this myself.
  18.  
  19. To use ISL productively, it is first necessary to understand a bit about
  20. how Imagine works.  Quite a bit.  I would not attempt to use this package
  21. if you are not comfortable with Imagine.  If you are struggling, I would
  22. recommend that you purchase Steve Worley's excellent book on the topic,
  23. "Understanding Imagine 2.0", read it, then come back (plug).
  24.  
  25. Back?  Good.  When you first create a Project in Imagine 2.0, Imagine
  26. creates a staging file in your whatever.imp directory.  This staging
  27. file, run through the ISL de-compiler destage, looks like this:
  28.  
  29.     STAGE
  30.     MAXFRAMES 1
  31.  
  32. The command to generate this file or one like it is:
  33.  
  34.     destage binarystage asciistage
  35.  
  36. where binarystage is the Imagine staging file and asciistage is where you
  37. want to put the ISL.
  38.  
  39. The ISL compiler will indeed eat this simple stage format.  Let's say you
  40. just want to add some frames.  You would then have something like this:
  41.  
  42.     STAGE
  43.     MAXFRAMES 100
  44.  
  45. The command to make this into a valid Imagine stage is:
  46.  
  47.     restage asciistage binarystage
  48.  
  49. where asciistage is your modified ISL source file and binarystage is where
  50. you want to put the new Imagine stage.  A word of caution:  it never hurts
  51. to make a backup copy of a staging file before stomping it!
  52.  
  53. That was too easy.  Onto ISL complexity level two.  :-)  If you bring up the
  54. Action editor and save the stage, without touching it, it will magically
  55. grow into something like this:
  56.  
  57.     STAGE
  58.     MAXFRAMES 1
  59.  
  60.     CAMERA "CAMERA"
  61.     POSITION FRAMES 1 1 XYZ 160.000000 -320.000000 160.000000
  62.     ALIGN FRAMES 1 1 XYZ 0.000000 0.000000 0.000000
  63.     SIZE FRAMES 1 1 XYZ 320.000000 640.000000 233.333328
  64.  
  65.     GLOBALS "GLOBALS"
  66.     ACTOR FRAMES 1 1 BRUSH "" 0 BACKDROP "" 0 AMBIENT RGB 0.000000 0.000000
  67.     0.000000 HORIZON RGB 0.000000 0.000000 0.000000 +ZENITH RGB 0.000000
  68.     0.000000 0.000000 -ZENITH RGB 0.000000 0.000000 0.000000 FOG BTL
  69.     0.000000 0.000000 0.000000 FOG RGB 0.000000 0.000000 0.000000
  70.     STARFIELD 0.000000 TRANSITION 0 SKYBLEND 0
  71.  
  72. Note the addition of a CAMERA clause and a GLOBALS clause.  Some detail is
  73. called for at this point.  ISL sentences generally correspond one-for-one
  74. to Action editor entries.  There will be one line containing the name from
  75. the far left-hand column of the Action editor entry (CAMERA "CAMERA" or
  76. GLOBALS "GLOBALS", etc.) followed by one line for each line or line segment
  77. in the Action editor.
  78.  
  79. So, for this simple stage, we have three clumps - the stagehdr, containing
  80. the STAGE and MAXFRAMES clause, the CAMERA clump, containing the name clause,
  81. a position clause, an alignment clause, and a size clause, and the globals
  82. clump, containg the name and the actor info.
  83.  
  84. Here is an ISL object entry, showing what happens when you swap three
  85. physical objects while changing their position and alignment:
  86.  
  87. OBJECT "PORTAL"
  88. ACTOR FRAMES 1 40 NAME "Portal.imp/objects/Portal" CYCLE 0.000000 0.000000 TRANSITION 0
  89. ACTOR FRAMES 41 60 NAME "Portal.imp/objects/Prtal" CYCLE 0.000000 0.000000 TRANSITION 0
  90. ACTOR FRAMES 61 100 NAME "Portal.imp/objects/Prtl" CYCLE 0.000000 0.000000 TRANSITION 0
  91. POSITION FRAMES 1 40 PATH "PATH" ACCEL 0 0.000000 DECEL 0 0.000000
  92. POSITION FRAMES 41 100 XYZ 0.000000 -1000.000000 0.000000
  93. ALIGN FRAMES 1 1 XYZ 0.000000 0.000000 0.000000
  94. ALIGN FRAMES 2 20 XYZ 0.000000 180.000000 0.000000
  95. ALIGN FRAMES 21 39 XYZ 0.000000 360.000000 0.000000
  96. SIZE FRAMES 1 1 XYZ 32.000000 32.000000 32.000000
  97.  
  98. Again, we start with the object name, then follow it with one ISL line for
  99. each Action editor line or line segment.  Note that there are two types of
  100. POSITION line here - the first follows a path "PATH", and the second is
  101. a tween position.  This example is from my flying Portal logo anim.
  102.  
  103. Here is another ISL object entry, showing an object with a SPFX clause:
  104.  
  105. OBJECT "EMERALD"
  106. ACTOR FRAMES 1 12 NAME "Emerald.imp/objects/emerald2.obj" CYCLE 0.000000 0.000000 TRANSITION 0
  107. POSITION FRAMES 1 1 XYZ 0.000000 0.000000 0.000000
  108. ALIGN FRAMES 1 1 XYZ 0.000000 0.000000 3.750000
  109. SIZE FRAMES 1 1 XYZ 5.000000 5.000000 6.500000
  110. EFFECT 1 FRAMES 1 12 Rotate2.0 "Effects/Rotate2.0" ZAXIS DEGREES 45.000000
  111.  
  112. Each Special Effect has it's own syntax.  Use EFFECT 1 for SF/X 1, EFFECT 2
  113. for SF/X 2.  The individual syntax for each effect is documented in ISL.BNF.
  114. Note that an effect is actually recognized by the fifth word, which in this
  115. case is Rotate2.0 - this following clause is the filename in quotes, so that
  116. your effects can live anywhere.
  117.  
  118. I think this ought to be enough to get started using ISL.  The actual syntax
  119. of the language is documented in the included ISL.BNF file.  The easiest way
  120. to get started would probably be to try destage-ing, modifying, and restage-
  121. ing your own files.  I'd stay out of ISL.BNF until you are pretty familiar
  122. with ISL or are stuck.
  123.  
  124. Hey, wait a minute, what about frames.c?  Oh, yeah.  It's a little stage
  125. generator I whipped up.  It's written in c, and produces a bunch of frames
  126. ready to be averaged together (for motion blur, of course).  Take it not as
  127. an example of sheer programming elegance, but rather as an idea of how to
  128. programmatically generate an ISL stage.
  129.  
  130.